home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple Reference & Presen…tion Library 2 (Reseller)
/
Apple R&P Lib Reseller v2.0.iso
/
3-Demos
/
HyperCard Demos
/
HyperMovies
/
CL⁄1
/
CL_1
/
background_9782.txt
< prev
next >
Wrap
Text File
|
1989-10-27
|
4KB
|
201 lines
-- background: 9782 from stack: in
-- bmap block id: 0
-- flags: 4000
-- background id: 0
-- name: Simulation Host
----- HyperTalk script -----
function API_Select query
--•• simplified emulation of the ‘select’ command
--only the field list can have more than 1 element.
if word 1 of query <> "select" then
answer "Illegal API_Select call: Wrong command."
exit to HyperCard
end if
get offset(";",query)
if it > 0 then delete char it to (number of chars of query) of query
--get the arguments for each clause
put empty into currentArg
put "select" into currentClause
put number of words of query into numWords
put empty into fieldList
put empty into tableName
put empty into critera
put empty into sortOrder
repeat with i = 1 to numWords
get word i of query
if it is not in "select,from,where,order" then
put it & space after currentArg
if i < numWords then next repeat
end if
put empty into last char of currentArg
if currentClause = "select" then
put currentArg into fieldList
else if currentClause = "from" then
put currentArg into tableName
else if currentClause = "where" then
put currentArg into critera
else if currentClause = "order" then
delete word 1 of currentArg --the word ‘by’
put currentArg into sortOrder
end if
put it into currentClause
put empty into currentArg
end repeat
put fieldList &":"& tableName &":"& critera &":"& sortOrder
return empty
end API_Select
on openBackground
push recent card
end openBackground
on openCard
global listScroll
put 0 into listScroll
setScroll listScroll
pass openCard
end openCard
on setScroll myScroll
--set the cursor to 4
set lockScreen to true
repeat with i = 1 to number of card fields
set the scroll of card field i to myScroll
end repeat
set lockScreen to false
--set the cursor to 1
end setScroll
on mouseEnter
if "card field" is not in the target then pass mouseEnter
global listScroll
get the scroll of the target
if it <> listScroll then
setScroll it
put it into listScroll
end if
end mouseEnter
on mouseLeave
if "card field" is not in the target then pass mouseLeave
global listScroll
get the scroll of the target
if it <> listScroll then
setScroll it
put it into listScroll
end if
end mouseLeave
-- part 2 (field)
-- low flags: 00
-- high flags: 0004
-- rect: left=10 top=35 right=56 bottom=503
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 15
-- part name: heading
-- part 3 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=10 top=9 right=34 bottom=444
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 20
-- text size: 18
-- style flags: 0
-- line height: 24
-- part name: card heading
-- part 4 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=462 top=300 right=338 bottom=500
-- title width / last selected line: 0
-- icon id / first selected line: 29114 / 29114
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: goBack
----- HyperTalk script -----
on mouseUp
visual zoom close to gray
visual zoom close
pop card
end mouseUp
-- part 5 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=481 top=253 right=286 bottom=510
-- title width / last selected line: 0
-- icon id / first selected line: 27009 / 27009
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: goNext
----- HyperTalk script -----
on mouseUp
get id of last card of background "Simulation Host"
if it = id of this card then
answer "This is the last card of simulation data."
exit mouseUp
end if
visual scroll left to gray
visual scroll left
go next
end mouseUp
-- part 6 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=448 top=253 right=285 bottom=478
-- title width / last selected line: 0
-- icon id / first selected line: 9301 / 9301
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: goPrev
----- HyperTalk script -----
on mouseUp
get id of first card of background "Simulation Host"
if it = id of this card then
answer "This is the first card of simulation data."
exit mouseUp
end if
visual scroll right to gray
visual scroll right
go prev
end mouseUp